﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master"
    CodeBehind="cakerProfile.aspx.vb" Inherits="diy_wc_prototype.cakerProfile" MaintainScrollPositionOnPostback="False" %>

<%@ Import Namespace="System.Data" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript">        var switchTo5x = false;</script>
    <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
    <script type="text/javascript">        stLight.options({ publisher: "148cbfe8-50b6-49fd-b788-ba5192c8c2fc" });</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ToolkitScriptManager runat="server">
    </asp:ToolkitScriptManager>
    <div class="cakeInfo">
        <asp:ListView ID="lv_title" runat="server">
            <ItemTemplate>
                <div class="pageTitle">
                    <h2 class="detailsImgCaption">
                        <%# Eval("userUName")%>
                    </h2>
                    Rated:
                    <%# getUserAvgRating(Eval("userAvgStar"))%>
                </div>
            </ItemTemplate>
        </asp:ListView>
    </div>
    <asp:Panel ID="panelCake" runat="server" CssClass="panelCake">
        <asp:ListView ID="lv_mainCake" runat="server">
            <ItemTemplate>
                <div id="cakeSecondaryImg">
                    <img src='<%# Eval("userImg") %>' />
                </div>
                <br class="clear" />
                <h2 class="clear">
                    About me</h2>
                <%# Eval("userDesc")%>
                <br />
                <h2 class="clear">
                    My Location</h2>
                <%# Eval("userLoc")%>
                <br />
            </ItemTemplate>
        </asp:ListView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:diycakeConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:diycakeConnectionString.ProviderName %>" 
            
            SelectCommand="SELECT TOP 10 * FROM [cakeViews] WHERE ([caker] = ?) ORDER BY ID DESC">
            <SelectParameters>
                <asp:QueryStringParameter Name="caker" QueryStringField="userUName" 
                    Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        <h3>Last 10 Cakes I viewed</h3>
        <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
          <ItemTemplate><a href='cakeProfile.aspx?ID=<%# Eval("cake_fkid")%>'>cakeProfile.aspx?ID=<%# Eval("cake_fkid")%></a><br /></ItemTemplate>
        </asp:Repeater>
        <br />
    </asp:Panel>
    <div id="consoles">
        <div class="panelUser pnlUserMargin">
            <asp:ListView ID="ParentLv" runat="server">
                <ItemTemplate>
                    <b>Joined:</b>
                    <br />
                    <%# Eval("userDateAdded", "{0:D}")%>
                    <h1 class="panelTitle">
                        My cake</h1>
                    <a href='cakeProfile.aspx?ID=<%# Eval("userCake")%>'>View</a>
                </ItemTemplate>
            </asp:ListView>
        </div>
    </div>
</asp:Content>
